package com.ecommerce.onion.application.request;

import com.ecommerce.onion.domain.Product;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.constraints.NotNull;
/**
 * @packageName: application.request（应用.请求）
 * @className: AddProductRequest(追加订单请求)
 * @description: 追加订单请求
 * @author: luds
 * @version: v1.0
 * @date: 2021-05/12
 */
public class AddProductRequest {
    /**
     * 产品
     */
    @NotNull
    private Product product;
    /**
     * 接收json数据形式的产品
     * @param product
     */
    @JsonCreator
    public AddProductRequest(@JsonProperty("product") final Product product) {
        this.product = product;
    }
    /**
     * 获取产品
     * @return 返回产品
     */
    public Product product() {
        return product;
    }
}
